/*     app.module.ts         */

/* TypeOrmModule.forRoot({
      type: 'mysql',
      host: 'localhost',
      port: 3306,
      username: 'root',
      password: '123456',
      database: 'nestbase',
      entities: [],
      synchronize: true, // 同步本地的schema与数据库，初始化时使用
      logging: ['error'],
    }), */

/* TypeOrmModule.forRootAsync({
      imports: [ConfigModule],
      inject: [ConfigService],
      useFactory: (configService: ConfigService) =>
        ({
          type: configService.get(ConfigEnum.DB_TYPE),
          host: configService.get(ConfigEnum.DB_HOST),
          port: configService.get(ConfigEnum.DB_PORT),
          username: configService.get(ConfigEnum.DB_USERNAME),
          password: configService.get(ConfigEnum.DB_PASSWORD),
          database: configService.get(ConfigEnum.DB_DATABASE),
          entities: [User, Profile, Roles, Logs],
          synchronize: configService.get(ConfigEnum.DB_SYNC),
          // logging: ['error'],
          // logging: process.env.NODE_ENV === 'development',
        }) as TypeOrmModuleOptions,
    }) */

// import { LoggerModule } from 'nestjs-pino';
/* LoggerModule.forRoot({
      pinoHttp: {
        transport:
        //   {
        //   targets: [
        //     {
        //       level: 'info',
        //       target: 'pino-pretty',
        //       options: {
        //         colorize: true,
        //       },
        //     },
        //     {
        //       level: 'info',
        //       target: 'pino-roll',
        //       options: {
        //         file: join('log', 'log.txt'),
        //         size: '10m',
        //         frequency: 'daily',
        //         mkdir: true,
        //       },
        //     },
        //   ],
        // },
          process.env.NODE_ENV === 'development'
            ? {
                level: 'info',
                target: 'pino-pretty',
                options: {
                  colorize: true,
                },
              }
            : {
                level: 'info',
                target: 'pino-roll',
                options: {
                  file: join('log', 'log.txt'),
                  size: '10m',
                  frequency: 'daily',
                  mkdir: true,
                },
              },
      },
    }), */
